namespace Reign.Core
{
	public static class Extensions
	{
		#region Strings and Text
		public static byte[] CastToBytes(this char[] input)
		{
			byte[] output = new byte[input.Length];
			for (int i = 0; i != input.Length; ++i) output[i] = (byte)input[i];
			return output;
		}
		
		public static byte[] CastToBytes(this string input)
		{
			byte[] output = new byte[input.Length];
			for (int i = 0; i != input.Length; ++i) output[i] = (byte)input[i];
			return output;
		}
		#endregion

		#region MathF32
		public static MathF64.Vector2 ToDouble2(this MathF32.Vector2 vector)
		{
			return new MathF64.Vector2(vector.X, vector.Y);
		}

		public static MathF64.Vector3 ToDouble3(this MathF32.Vector3 vector)
		{
			return new MathF64.Vector3(vector.X, vector.Y, vector.Z);
		}

		public static MathF64.Vector4 ToDouble4(this MathF32.Vector4 vector)
		{
			return new MathF64.Vector4(vector.X, vector.Y, vector.Z, vector.W);
		}

		public static MathI32.Vector2 ToInt2(this MathF32.Vector2 vector)
		{
			return new MathI32.Vector2((int)vector.X, (int)vector.Y);
		}

		public static MathI32.Vector3 ToInt3(this MathF32.Vector3 vector)
		{
			return new MathI32.Vector3((int)vector.X, (int)vector.Y, (int)vector.Z);
		}

		public static MathI32.Vector4 ToInt4(this MathF32.Vector4 vector)
		{
			return new MathI32.Vector4((int)vector.X, (int)vector.Y, (int)vector.Z, (int)vector.W);
		}
		#endregion

		#region MathF64
		public static MathF32.Vector2 ToFloat2(this MathF64.Vector2 vector)
		{
			return new MathF32.Vector2((float)vector.X, (float)vector.Y);
		}

		public static MathF32.Vector3 ToFloat3(this MathF64.Vector3 vector)
		{
			return new MathF32.Vector3((float)vector.X, (float)vector.Y, (float)vector.Z);
		}

		public static MathF32.Vector4 ToFloat4(this MathF64.Vector4 vector)
		{
			return new MathF32.Vector4((float)vector.X, (float)vector.Y, (float)vector.Z, (float)vector.W);
		}

		public static MathI32.Vector2 ToInt2(this MathF64.Vector2 vector)
		{
			return new MathI32.Vector2((int)vector.X, (int)vector.Y);
		}

		public static MathI32.Vector3 ToInt3(this MathF64.Vector3 vector)
		{
			return new MathI32.Vector3((int)vector.X, (int)vector.Y, (int)vector.Z);
		}

		public static MathI32.Vector4 ToInt4(this MathF64.Vector4 vector)
		{
			return new MathI32.Vector4((int)vector.X, (int)vector.Y, (int)vector.Z, (int)vector.W);
		}
		#endregion

		#region MathI32
		public static MathF32.Vector2 ToFloat2(this MathI32.Vector2 vector)
		{
			return new MathF32.Vector2(vector.X, vector.Y);
		}

		public static MathF32.Vector3 ToFloat3(this MathI32.Vector3 vector)
		{
			return new MathF32.Vector3(vector.X, vector.Y, vector.Z);
		}

		public static MathF32.Vector4 ToFloat4(this MathI32.Vector4 vector)
		{
			return new MathF32.Vector4(vector.X, vector.Y, vector.Z, vector.W);
		}

		public static MathF64.Vector2 ToDouble2(this MathI32.Vector2 vector)
		{
			return new MathF64.Vector2(vector.X, vector.Y);
		}

		public static MathF64.Vector3 ToDouble3(this MathI32.Vector3 vector)
		{
			return new MathF64.Vector3(vector.X, vector.Y, vector.Z);
		}

		public static MathF64.Vector4 ToDouble4(this MathI32.Vector4 vector)
		{
			return new MathF64.Vector4(vector.X, vector.Y, vector.Z, vector.W);
		}
		#endregion
	}
}